<form action="<?php e_action("shopModifySubmit"); ?>" method="post"  enctype="multipart/form-data">
    <input type="hidden" name="id" id="id"  value="<?php echo $r['id'];?>"/><br/>
    <input type="hidden" name="address_id" id="address_id" value="<?php echo $r['address_id']?>"/>
    <fieldset>
        <legend>商家基本信息</legend>
        <label for="company">商家名称</label>
        <input type="text" name="company" id="company"  value="<?=$r['company'];?>"/><br/>
        <label for="company_pic">商家照片</label>
        <img width="180" src="<?php if(is_array($r['company_pic'])){foreach($r['company_pic'] as $v){ echo $v['url'];?><?php }?><?php }else echo $r['company_pic']?>"/><br/>
        <label for="license_pic">营业执照</label>
        <img width="180" src="<?php if(is_array($r['license_pic'])){foreach($r['license_pic'] as $v){ echo $v['url'];?><?php }?><?php }else echo $r['license_pic']?>"/><br/>
<!--        <label for="introduction">简介</label><br/>-->
<!--        <textarea name="introduction" id="introduction">--><?php //echo $r['introduction']?><!--</textarea><br/>-->
        <label for="shop_address">商家地址</label>
        <div class="js-select-address-box" style="display:inline-block">
            <select class="js-select-address"></select>    
        </div>
        <input type="text" name="shop_address" id="shop_address" readonly value="<?=$r['shop_address'];?>"/><button class="update-address">修改</button> <br/>
        <label for="address_text">商家具体地址</label>
        <input type="text" name="address_text" id="address_text"  value="<?=$r['address_text'];?>"/>
    </fieldset>
    <fieldset>
        <legend>商家简介</legend>
        <script id="introduction" name="introduction" class="editor" type="text/plain" ><?=$r['introduction'];?></script>
    </fieldset>
    <fieldset>
        <legend>负责人基本信息</legend>
        <label for="real_name">姓名</label>
        <input type="text" name="real_name" id="real_name"  value="<?=$r['real_name'];?>"/><br/>
        <label for="sex">性别</label>
        <input type="radio" name="sex" id="sex" value="male" <?php if($r['sex']=='male') echo 'checked';?>>男
        <input type="radio" name="sex" id="sex" value="female" <?php if($r['sex']=='female') echo 'checked';?>>女<br/>
        <label for="birth">出生日期</label>
        <input type="text" name="birth" id="birth" value="<?=$r['birth'];?>"/><br/>
        <label for="tel">联系方式</label>
        <input type="text" name="tel" id="tel" value="<?=$r['tel'];?>"/><br/>
<!--        <label for="qq">QQ</label>-->
<!--        <input type="text" name="qq" id="qq" value="--><?//=$r['qq'];?><!--"/><br/>-->
        <label for="nation">民族</label>
        <input type="text" name="nation" id="nation" readonly value="<?=$r['nation'];?>"/><br/>
        <label for="email">邮箱</label>
        <input type="text" name="email" id="email" value="<?=$r['email'];?>"/><br/>
        <label for="academic">学历</label>
        <input type="text" name="academic" id="academic" value="<?=$r['academic'];?>"/><br/>
        <label for="address">现居地址</label>
        <input type="text" name="address" id="address" value="<?=$r['address'];?>"/><br/>
        <label for="computer_skill">电脑水平</label>
        <input type="text" name="computer_skill" id="computer_skill" value="<?=$r['computer_skill'];?>"/><br/>
        <label for="idnum">身份证号码</label>
        <input type="text" name="idnum" id="idnum" value="<?=$r['idnum'];?>"/><br/>
        <label for="idnum_pic">身份证照片</label>
        <img width="180" src="<?php if(is_array($r['idnum_pic'])){foreach($r['idnum_pic'] as $v){ echo $v['url'];?><?php }?><?php }else echo $r['idnum_pic']?>"/><br/>
        <label for="recent_pic">近照</label>
        <img width="180" src="<?php if(is_array($r['recent_pic'])){foreach($r['recent_pic'] as $v){ echo $v['url'];?><?php }?><?php }else echo $r['recent_pic']?>"/><br/>
    </fieldset>
    <fieldset>
        <legend>地图选择(拖拽地图地图中的标志设置)</legend>
        <label for="longitudeInput">商城经度</label>
        <input type="text" name="longitude" id="longitudeInput" value="<?=$r['longitude'];?>" readonly placeholder="拖拽地图地图中的标志设置经度"/>
        <br/>
        <label for="latitudeInput">商城纬度</label>
        <input type="text" name="latitude" id="latitudeInput" value="<?=$r['latitude'];?>" readonly placeholder="拖拽地图地图中的标志设置纬度"/>
        <br/>
        <div id="allmap" style="margin-left:15px;width:600px;height:320px;"></div>
    </fieldset>
    <input  type="submit" value="保存">
</form>
<script type="text/javascript" src="plugin/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
    _root = "<?php echo $system['siteRoot'];?>";
</script>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript" src="script/simpleAddress.js"></script>
<script type="text/javascript">
    $(function(){
        var select = $(".js-select-address-box").hide();
        var input  = $("#shop_address").show();
        var button = $(".update-address").show();
        button.click(function(e){
            e.preventDefault()
            select.show();
            input.hide();
            button.hide()
            $('#address_id').remove();
        })
    })
</script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=HNtF8PpKdoLMQTDurEuZUVTE"></script>
<script type="text/javascript">
    var map = new BMap.Map("allmap");
    map.addControl(new BMap.NavigationControl());
    map.enableScrollWheelZoom();    //启用滚轮放大缩小
    map.enableContinuousZoom();    //启用地图惯性拖拽
    //map.setZoom(10);
    var longitude=Number($("[name=longitude]").val()) || 117.565297;
    if(longitude>120|| longitude<115) longitude=117.565297;
    var latitude=Number($("[name=latitude]").val()) || 33.547786;
    if(latitude>35|| latitude<30) latitude=33.547786;
    var point = new BMap.Point(longitude,latitude);
    map.centerAndZoom(point,13);
    var marker = new BMap.Marker(point);
    map.addOverlay(marker);
    marker.enableDragging();
    marker.addEventListener("dragend", function(e){
        var p = e.point;
        $("[name=latitude]").val(p.lat);
        $("[name=longitude]").val(p.lng);
    });
</script>